package com.qzy;

import com.sun.org.apache.xml.internal.security.exceptions.Base64DecodingException;
import com.sun.org.apache.xml.internal.security.utils.Base64;

import java.util.Arrays;

/**
 * @描述
 * @创建人 joy_qiu
 * @创建时间 2019-11-12-10:55
 * @修改人和其它信息
 */
public class Java8Test implements Runnable{

    public static void main(String[] args) {
        /**
        * base64 start
        */
        /*String str = "hello java";
        final String encode = Base64.encode(str.getBytes());
        System.out.println("base64 加密后【】"+encode);

        try {
        final byte[] decode =  Base64.decode(encode);
        System.out.println("base64 解密后的【】"+new String(decode));
        } catch (Base64DecodingException e) {
        e.printStackTrace();
        }*/
        /**
        * base64 end
        */

        /**
        * thread start
        */
       /* Java8Test java8Test = new Java8Test();
        Thread t = new Thread(java8Test);
        t.start();
        System.out.println("i am main thread");*/
        /**
         * thread end
         */

        /**
         * lambda start
         */
        Arrays.asList( "a", "b", "c" ).forEach((String e) -> System.out.println( e ) );
        Arrays.asList( "a", "b", "d" ).sort( ( e1, e2 ) -> e1.compareTo( e2 ) );
        /**
         * lambda end
         */
    }

    public void run() {
        System.out.println("i am iron man!");
    }
}
